The Dreamweaver JavaScript API > String manipulation functions > dreamweaver.getTokens() |
![]() ![]() ![]() |
Availability
Dreamweaver 1.0
Description
Accepts a string and splits it into tokens.
Arguments
searchString
, separatorCharacters
![]() |
searchString is the string to be separated into tokens. |
![]() |
separatorCharacters is the character or characters that signifies the end of a token. Separator characters in quoted strings are ignored. If separatorCharacters contains a space, all white-space characters (for example, tabs) are treated as separator characters as if you had explicitly specified them. Two or more consecutive white space characters are treated as a single separator. |
Returns
An array of token strings.
Enabler
None.
Example
dreamweaver.getTokens('foo("my arg1", 34)', '(),')
returns the tokens:
![]() |
foo |
![]() |
"my arg 1" |
![]() |
34 |
![]() ![]() ![]() |